<template>
	<div>
		<div style="border: 1px solid slateblue; height: 18vh;">
			<h3 align="center">导航栏</h3>
			<div style="width: 70%;  display: flex; margin: auto;   justify-content: space-between;">
				<div><a>姓名: {{$store.state.user.name}}</a></div>
				<div><a>角色:{{$store.state.user.rloename}}</a></div>
				
				<div><a><img style="width: 5vw;height: 5vw;"
						v-bind:src="this.$ip +'/api/public/showimg/'+ this.$store.state.user.pic">
				 </a></div>

				<button @click="loguot()">退出</button>
			</div>

		</div>
		<div style=" display: flex; justify-content: space-between;height:800vw ;border: 1px solid saddlebrown;">

				<router-view></router-view>

		</div>
	</div>
</template>


<script>
	export default {
		props :{
		},
		methods: {
           loguot(){
			   this.$store.state.user= {
				 name:"",
				 rloe:'',
				 rloename:"",
				 token:'',
				 pic:''};
	
	   window.localStorage.setItem("token","")
	   this.$router.push('/Login')
		   }  
		},			
		// computed: {
		// 		  rloe() {
		// 		  var value=this.$store.state.user.rloe;
		// 		  console.log(value)
		// 			 if(value=="adm") this.rloe="管理员"
		// 			 if(value=="stu") this.rloe="学生"
		// 			 if(value=="tea") this.rloe="教师"
		// 			 console.log(value)
					 
		// 		   return this.rloe
		// 		 }
			
		// },
		mounted() {
			this.$router.push("/login")
			// this.$router.push("/adm")
		}

		
	}
</script>


<style>
	/* #app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */
</style>